<?php

namespace Home\Controller;

use Utuo\ForegroundController;

class MicroAllianceController extends ForegroundController {
	public function _init() {
		layout ( false );
		C ( 'TOKEN_ON', false );
	}
	public function indexAction($id) {
		$condation = array (
				'status' => 1,
				'is_deleted' => 0,
				'cid' => $this->sid,
				'id' => $id 
		);
		$microAlliance = M ( 'MicroAlliance' )->where ( $condation )->find ();
		
		$where = array (
				'status' => 1,
				'is_deleted' => 0,
				'cid' => $this->sid,
				'micro_alliance_id' => $id 
		);
		$microAllianceContent = M ( 'MicroAllianceContent' )->where ( $where )->order ( 'sort asc' )->select ();
		
		$this->assign ( 'microAlliance', $microAlliance );
		$this->assign ( 'microAllianceContent', $microAllianceContent );
		$this->display ();
	}
}